package desktop.lan.remote.util;

import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

import desktop.lan.LanInfo;

public class RmiServiceConf {

	private static boolean serviceRunning = false;

	public static synchronized void runService() {
		if (!RmiServiceConf.serviceRunning) {
			try {
				LocateRegistry.createRegistry(LanInfo.getSelfPort());
			} catch (RemoteException e) {
				e.printStackTrace();
			}
			RmiServiceConf.serviceRunning = true;
		}
	}

}